package com.zhengsr.latte.ec.ec.main.recyclerview;

import android.util.Log;
import android.view.View;

import com.zhengsr.latte.delegates.LatteDelegate;
import com.zhengsr.latte.ec.ec.main.gooddetial.GoodsDetialDelagate;
import com.zhengsr.latte.ui.recycler.adapter.callback.RBaseListenerAdapter;

/**
 * Created by zhengshaorui on 2018/5/28.
 */

public class ItemClickListener extends RBaseListenerAdapter {
    private static final String TAG = "ItemClickListener";
    private final LatteDelegate PARENT;
    private ItemClickListener(LatteDelegate delegate){
        Log.d(TAG, "zsr --> ItemClickListener: "+delegate);
        PARENT = delegate;
    }

    public static ItemClickListener create(LatteDelegate delegate){
        return new ItemClickListener(delegate);
    }

    @Override
    public void onItemClick(View view, int position) {
        super.onItemClick(view, position);
        PARENT.start(new GoodsDetialDelagate());
    }

    @Override
    public boolean onItemLongClick(View view, int position) {
        return super.onItemLongClick(view, position);
    }

    @Override
    public void onItemChildClick(View view, int position) {
        super.onItemChildClick(view, position);
    }

    @Override
    public boolean onItemChildLongClick(View view, int position) {
        return super.onItemChildLongClick(view, position);
    }
}
